Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickTime Components /
Chapter 3 - Standard Image-Compression Dialog Components / Standard Image-Compression Dialog Components Reference
Standard Image-Compression Dialog Component Functions / Specifying a Test Image


SCSetTestImagePictFile

The SCSetTestImagePictFile function sets the dialog box's test image from a picture that is stored in a picture file.

pascal ComponentResult SCSetTestImagePictFile 
                        (ComponentInstance ci, short testFileRef,
                           Rect *testRect, short testFlags);
ci
Identifies your application's connection to a standard image-compression dialog component.
testFileRef
Identifies the file that contains the new test image. Your application is responsible for opening this file before calling this function. You must also close the file when you are done with it. You must clear the image or close your connection to the standard image-compression dialog component before you close the file. If the file contains a large image, the component may take some time to display the standard image-compression dialog box. In this case, the component displays the watch cursor while it loads the test image.
Set this parameter to 0 to clear the test image.
testRect
Contains a pointer to a rectangle structure. This rectangle specifies, in the coordinate system of the source image, the area of interest or point of interest in the test image. The area of interest defines a portion of the test image that is to be shown to the user in the dialog box. Use this parameter to direct the component to a specific portion of the test image. The component uses the value of the testFlags parameter to determine how it transforms large images before displaying them to the user.
You may specify a point of interest by setting the points in the rectangle structure so that they enclose a single point--for example, (0,0) and (1,1). The component centers this point in the image that is displayed in the dialog box, and displays the part of the image that fits in the test image portion of the dialog box.
To use the entire picture file, pass nil in this parameter.
testFlags
Specifies how the component is to display a test image that is larger
than the test image portion of the dialog box. If you set this parameter
to 0, the component uses a default method of its own choosing. In all cases, the component centers the area or point of interest in the test image portion of the dialog box, and then displays some part of the test image.
You may indicate your display preference by setting this parameter to one of the following values:
scPreferCropping

Indicates that the component should crop the test image to fit the test image portion of the dialog box. The component displays the part of the image that fits in the test image portion of the box. If the image is smaller than the space alloted in the dialog box, the component does not alter the image before displaying it--the resulting image is smaller than the available space.
scPreferScaling

Indicates that the component should scale the test image
to fit the test image portion of the dialog box. The component shrinks the image to fit the test image portion of the dialog box.
scPreferScalingAndCropping

Indicates that the component should both scale and crop the test image. This option is useful with very large test images. The component first shrinks the image to approximately the size of the test image portion of the dialog box, then trims the image so that it fits the available space.
RESULT CODES
paramErr-50Invalid parameter specified
File Manager errors


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help